<?php include($folder.'/layouts/templates/backend/header.tpl') ?>
<?php
$master['toolbarItems'] = array(
	'<input type="submit" class="button" value="Mentés" />',
	'<input type="button" class="button" onclick="javascript: window.location.href=\''.$prefix.'/adminisztracio/galeriak?vissza\';" value="Vissza" />'
);
?>
<?php include($folder.'/layouts/templates/backend/middle.tpl') ?>
<?php if (!empty($_SESSION['id'])): ?>
	<?php echo inputHidden(array('dataBinding'=>'main', 'dataField'=>'id')) ?>
	<table cellspacing="0">
		<tr>
			<td class="label">Kategória:</td>
			<td class="fieldControl">
				<?php echo htmlSelect(array(
					'dataBinding' => 'main',
					'dataField' => 'gallery_id',
					'id' => 'galleries',
					'attributes' => 'style="width:350px"')) ?>
			</td>
		</tr>
		<tr>
			<td class="label">Név:</td>
			<td class="fieldControl"><?php echo inputText(array(
				'dataBinding' => 'main',
				'dataField' => 'name',
				'attributes' => 'style="width:350px"')) ?></td>
		</tr>
<?php if ($_GET['id'] !== null && $_GET['id'] !== ''): ?>
		<tr>
			<td colspan="2">
<?php echo extendedTable(array(
	'header' => 
		'<table cellpadding="0" cellspacing="0" style="width:100%"><tr><td style="width:100%">'.
		paginator(array(
			'id' => 'main',
			'parameters' => array($_GET['id']),
			'itemsPerPage' => 12,
			'itemsPerPageAll' => array(4,8,12,24,48,96),
			'selectCountMethod' => 'pictures_in_gallery_select_count')).
		'</td><td style="white-space:nowrap"><input type="button" value="Hozzáadás" class="button" '.
		'onclick="window.open(\'/valaszto/kep?hivo=1&galeria='.$_GET['id'].'\',\'PicturePickup\',\'status=no,toolbar=no,menu=no,location=no,directories=no,'.
		'scrollbars=yes,width=900,height=650\');" />&nbsp;<input type="submit" name="submitaction_gallerypicture_delete" value="Törlés" class="button" onclick="return confirm(\'Biztos, hogy törölni szeretnéd a kiválasztott képeket a galériából?\')" /></td></tr></table>',
	'body' => dataList(array(
		'columnCount' => 4,
		'parameters' => array($_GET['id']),
		'selectMethod' => 'pictures_in_gallery_select',
		'cellTemplate' => '<table cellspacing="0px" cellpadding="0px">
				<tr>
					<td>
						<label for="picture{pictureID}">
						<img src="'.$prefix.'/kep-kicsi?id={pictureID}" />
						</label>
					</td>
				</tr>
			<tr>
				<td>
					<center>
					<input type="checkbox" name="main[picture_id][]" value="{pictureID}" id="picture{pictureID}" />
					</center>
				</td>
			</tr>
			</table>',
		'itemsPerPage' => 12,
		'id' => 'main')),
	'footer' => paginator(array(
		'subId' => 'paginator2',
		'isFirst' => false,
		'id' => 'main',
		'parameters' => array($_GET['id']),
		'itemsPerPage' => 12,
		'itemsPerPageAll' => array(4,8,12,24,48,96),
		'selectCountMethod' => 'pictures_in_gallery_select_count')))) ?>
			</td>
		</tr>
<?php endif; ?>
	</table>
<?php endif; ?>
<?php include($folder.'/layouts/templates/backend/footer.tpl') ?>